package inseniarlingua.lang;

import java.util.Map;

public abstract class VerbsFactory
{
	private Class<?> verbClass;
	
	public VerbsFactory(Class<?> verbClass) {
		super();
		this.verbClass = verbClass;
	}

	protected Map<String, VerbDef> irregularVerbMap;
	
	protected abstract Map<String, VerbDef> getIrregularVerbMap();
	
	public VerbDef getVerb(String verb) {
		VerbDef ret = getIrregularVerbMap().get(verb);
		if (ret == null) {
			try {
				ret = (VerbDef)verbClass.newInstance();
				ret.setInfinitive(verb);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		return ret;
	}
}
